home *** CD-ROM | disk | FTP | other *** search
- <head>
-
- <title>###SHOP_NAME### : ###SHOP_DESCRIPTION###</title>
-
- <meta name=description content="###SHOP_NAME### : ###SHOP_DESCRIPTION###">
-
- <meta name=keywords content="###SHOP_NAME### : ###SHOP_DESCRIPTION### : msrtcm : ms105">
-
- </head>
-
- <body background="images/###MENU_BGGRAPHIC###" bgcolor="###BG_COLOR###" text="###TEXT_COLOR###" link="###LINK_COLOR###" vlink="###VLINK_COLOR###" alink="###ALINK_COLOR###">
-
-
- <center>
-
- <script language="JavaScript">
-
- MaxCartItems = 15;
-
- function getCookieVal (offset) {
- var endstr = document.cookie.indexOf (";", offset);
- if (endstr == -1)
- endstr = document.cookie.length;
- return unescape(document.cookie.substring(offset, endstr));
- }
-
- function GetCookie (name) {
- var arg = name + "=";
- var alen = arg.length;
- var clen = document.cookie.length;
- var i = 0;
- while (i < clen) {
- var j = i + alen;
- if (document.cookie.substring(i, j) == arg)
- return getCookieVal (j);
- i = document.cookie.indexOf(" ", i) + 1;
- if (i == 0) break;
- }
- return null;
- }
-
- function SetCookie (name, value) {
- var argv = SetCookie.arguments;
- var argc = SetCookie.arguments.length;
- var expires = (argc > 2) ? argv[2] : null;
- var path = (argc > 3) ? argv[3] : null;
- var domain = (argc > 4) ? argv[4] : null;
- var secure = (argc > 5) ? argv[5] : false;
- document.cookie = name + "=" + escape (value) +
- ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
- ((path == null) ? "" : ("; path=" + path)) +
- ((domain == null) ? "" : ("; domain=" + domain)) +
- ((secure == true) ? "; secure" : "");
- }
-
- function DeleteCookie (name) {
- var exp = new Date();
- exp.setTime (exp.getTime() - 1); // This cookie is history
- var cval = GetCookie (name);
- if (cval != null)
- document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
- }
-
- function ShowCart()
- {
- totprice = 0;
- itemlist = 0;
-
- document.writeln('<form>');
- document.writeln('To change quantity, edit number then click anywhere on this frame<p>');
- document.writeln('<table border=2 cellspacing=5 cellpadding=5>');
- document.writeln('<tr><td align=center><b>###ID###</b></td><td align=center><b>###DESCRIPTION###</b></td><td align=center><b>###QTY###</b></td><td align=center><b>###PRICE_EACH###</b></td><td align=center><b>###PRICE_TOTAL###</b></td><td align=center><b>###ACTION###</b></td></tr>');
-
- for(NumItems = 0; NumItems<MaxCartItems; NumItems++)
- {
- CookieName = "Cart" +NumItems;
- CookieValue = GetCookie(CookieName);
-
- if(CookieValue != null)
- {
- for(var i = 0;i <= CookieValue.length; i++)
- {
- // using 0192,0193,0194,0195,0196
- if (CookieValue.substring(i,i+1) == '[')
- {
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == '└')
- {
- ID = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == '┴')
- {
- Sdesc = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == '┬')
- {
- Price = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == '├')
- {
- itemend = i;
- Qty = CookieValue.substring(itemstart, itemend);
- ItemTotal = 0;
- ItemTotal = (eval(Price*Qty));
- temptotal = ItemTotal * 100;
- totprice = totprice + ItemTotal;
- itemlist=itemlist+1;
-
- FItemTotal = FloatFormat(ItemTotal,2);
- document.writeln('<tr><td>'+ID+'</td><td>'+Sdesc+'</td><td align=right><input method=post name=Qty'+NumItems+' type=text size=3 onChange=QtyChange('+NumItems+',Qty'+NumItems+'.value) value='+Qty+'></td><td align=right>'+Price+'</td><td align=right>'+FItemTotal+'</td><td><a href="javascript:RemoveItem('+NumItems+')">Remove</a></td></tr>');
- }
- else if (CookieValue.substring(i,i+1) == '─')
- {
- Weight = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == ']')
- {
- WeightUnit = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- }
- }
- }
-
- Ftotprice = FloatFormat(totprice,2);
- document.writeln('<tr><td colspan=4><b>Sub Total</b></td><td align=right>'+Ftotprice+'</td><td></td></tr>');
- document.writeln('</table>');
- document.writeln('</form>');
- }
-
- function QtyChange(itemnum,Qty)
- {
- CookieName = "Cart" +itemnum;
- CookieValue = GetCookie(CookieName);
-
- for(var i = 0;i <= CookieValue.length; i++)
- {
- // using 0192,0193,0194,0195,0196
- if (CookieValue.substring(i,i+1) == '[')
- {
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == '└')
- {
- ID = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == '┴')
- {
- Sdesc = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == '┬')
- {
- Price = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == '├')
- {
- OldQty = CookieValue.substring(itemstart, itemend);
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == '─')
- {
- Weight = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- else if (CookieValue.substring(i,i+1) == ']')
- {
- WeightUnit = CookieValue.substring(itemstart, i);
- itemstart = i+1;
- }
- }
-
- NewCookieValue = "["+ID+"└"+Sdesc+"┴"+Price+"┬"+Qty+"├"+Weight+"─"+WeightUnit+"]";
- if(Qty <= 0)
- DeleteCookie(CookieName)
- else
- SetCookie(CookieName,NewCookieValue);
-
- self.location = "cart.htm";
- }
-
- function RemoveItem(itemnum)
- {
- CookieName = "Cart" +itemnum;
- DeleteCookie(CookieName);
- self.location = "cart.htm";
- }
-
- function EmptyCart()
- {
- if(confirm('###ARE_YOU_SURE_EMPTY_CART###'))
- {
- for(NumItems = 0; NumItems<MaxCartItems; NumItems++)
- {
- CookieName = "Cart" +NumItems;
- DeleteCookie(CookieName);
- }
-
- self.location = "cart.htm";
- }
- }
-
- function FloatFormat(expr,decplaces)
- {
- var str = "" + Math.round(eval(expr) * Math.pow(10,decplaces));
- while(str.length <= decplaces)
- {
- str = "0" + str;
- }
-
- var decpoint = str.length - decplaces;
- return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length);
- }
-
- function Dollarize(expr)
- {
- return "$" + format(expr,2);
- }
-
- </script>
-
- <script language="JavaScript">
- ShowCart();
- </script>
-
- <form>
- <input type=button name=clear value="###EMPTY_SHOPPING_CART###" onClick="EmptyCart()">
- </form>
-
- </center>
-